package br.com.intelsys.basics.action;

import java.util.Iterator;

/**
 * Iterator para atender o CookieList
 * 
 * @author Patrick Givisiez
 * 
 */

public class CookieIterator implements Iterator<Object> {
	private javax.servlet.http.Cookie[] cookieList;
	private int i = 0;

	CookieIterator(javax.servlet.http.Cookie[] cookieList) {
		this.cookieList = cookieList;
	}

	public boolean hasNext() {
		return (i < cookieList.length);
	}

	public Object next() {
		return (new Cookie(this.cookieList[this.i++]));
	}

	public void remove() {
		this.cookieList[this.i++].setValue(null);
	}

}
